<template>
	<view>
		<view class="share">
			<!-- <view class="font-lg text-center font-weight mb-1">修改活动</view> -->

			<view>
				<text class="text">修改后活动名称：</text>
				<input type="text" v-model="huodong.actname" class="br-1 p-1 mt-1 mb-2 bg-light-secondary font-md" style="height: 60rpx;" />
			</view>

			<view class="mr-2">
				<text class="text">修改后活动内容：</text>
				<textarea v-model="huodong.actcontent" :placeholder="huodong.actcontent" class="br-1 p-1 mt-1 mb-2 bg-light-secondary font-md" style="width: 650rpx; height: 150rpx;" />
			</view>
			
			
			<view>
				<text class="text">修改后活动报名价格：</text>
				<input type="text" v-model="huodong.price" :placeholder="huodong.price == '' ? '还未设置报名价格' : huodong.price" class="br-1 p-1 mt-1 mb-2 bg-light-secondary font-md" style="height: 60rpx;" />
			</view>
			
			<!-- <view>
				<view style="display: flex; justify-content: space-between; align-items: center;">
					<text>报名是否需支付</text>
					<switch :checked="sginprice" @change="switchChange" v-model="huodong.whetherpay" style="transform:scale(0.7)" color="#475dfc"></switch>
				</view>
				<view v-show="sginprice">
					<text class="text">修改后活动报名价格：</text>
					<input type="text" v-model="huodong.price" class="br-1 p-1 mt-1 mb-2 bg-light-secondary font-md" style="height: 60rpx;" />
				</view>
			</view> -->
			
			<!-- <view>
				<text class="text">修改后报名前按钮文字：</text>
				<input type="text" v-model="huodong.before_authorize_btn" class="br-1 p-1 mt-1 mb-2 bg-light-secondary font-md"
				 style="height: 60rpx;" />
			</view>
			
			<view>
				<text class="text">修改后报名后按钮文字：</text>
				<input type="text" v-model="huodong.after_authorize_btn" class="br-1 p-1 mt-1 mb-2 bg-light-secondary font-md"
				 style="height: 60rpx;" />
			</view> -->
			
			<view>
				<text class="text">修改后活动授权链接：</text>
				<input type="text" v-model="huodong.link" :placeholder="huodong.link == '' ? '还未设置授权链接' : huodong.link" class="br-1 p-1 mt-1 mb-2 bg-light-secondary font-md"
				 style="height: 60rpx;" />
			</view>
			
			<view>
				<text class="text">修改后活动分享主标题：</text>
				<input type="text" v-model="huodong.sharemaintitle" :placeholder="huodong.sharemaintitle == '' ? '还未设置分享主标题' : huodong.sharemaintitle" class="br-1 p-1 mt-1 mb-2 bg-light-secondary font-md"
				 style="height: 60rpx;" />
			</view>
			
			<view class="mr-2">
				<text class="text">修改后活动分享副标题：</text>
				<textarea v-model="huodong.sharetitle" :placeholder="huodong.sharetitle == '' ? '还未设置分享副标题' : huodong.sharetitle" class="br-1 p-1 mt-1 mb-2 bg-light-secondary font-md" style="width: 650rpx; height: 150rpx;" />
			</view>
			
			<view class="d-flex mb-2">
				<view>修改主题色：</view>
				<view @click="show_color_picker()" :style="{background:this.huodong.background}" class="mcolor" ></view>
				<t-color-picker ref="colorPicker" :color="color" @confirm="confirm"></t-color-picker>
			</view>
			<divider />
			
			<view class="d-flex flex-column">
				<view class="d-flex flex-row j-sb align-center">
					<view class="text">头部图片：</view>
					<view @click="uploadImage('headimage')" class="mainupdata">修改</view>
				</view>
				<view class="d-flex">
					<image :src="huodong.headimage ? huodong.headimage : '../../static/up-img.png'" :class="huodong.headimage ? 'upimg' : 'img'"></image>
				</view>
			</view>
			<divider />
			
			<view class="d-flex flex-column">
				<view class="d-flex flex-row j-sb align-center">
					<view class="text">底部图片：</view>
					<view @click="uploadImage('footimage')" class="mainupdata">修改</view>
				</view>
				<view class="d-flex a-start">
					<image :src="huodong.footimage ? huodong.footimage : '../../static/up-img.png'" :class="huodong.footimage ? 'upimg' : 'img'"></image>
				</view>
			</view>
			<divider />
			
			<view class="d-flex flex-column">
				<view class="d-flex flex-row j-sb align-center">
					<view class="text">视频头部图片：</view>
					<view @click="uploadImage('vidtopimg')" class="mainupdata">修改</view>
				</view>
				<view class="d-flex">
					<image :src="huodong.vidtopimg ? huodong.vidtopimg : '../../static/up-img.png'" :class="huodong.vidtopimg ? 'upimg' : 'img'"></image>
				</view>
			</view>
			<divider />
			
			<view class="d-flex flex-column">
				<view class="d-flex flex-row j-sb align-center">
					<view class="text">分享图片：</view>
					<view @click="uploadImage('shareimage')" class="mainupdata">修改</view>
				</view>
				<view class="d-flex">
					<image :src="huodong.shareimage ? huodong.shareimage : '../../static/up-img.png'" :class="huodong.shareimage ? 'upimg' : 'img'"></image>
					<!-- <image :src="huodong.headimage" class="upimg"> -->
				</view>
			</view>
			<divider />
			
			<view>
				<view class="modvideo">
					<view class="flex-3">主视频：</view>
					<!-- <view @tap="openaddmainVideo()" class="mainupdata">+ 重新上传</view> -->
					<view @tap="openaddmainVideo()" class="mainupdata">修改</view>
				</view>
				<divider />
				
				<view v-if="!huodong.mainvideo">
					<view class="text-center mb-2">还未上传主视频，请先上传!</view>
				</view>
				<video v-else :src="huodong.mainvideo" :poster="huodong.main_video_cover" class="video"></video>
			</view>
			<divider />
			
			<!-- 视频列表 -->
			<view>
				<view class="modvideo mb-2">
					<view>宣传视频：</view>
					<view @tap="$refs.openAlertaddVideo.Show()" class="addmodvid">+ 新增视频</view>
				</view>
				<divider />
				
				<block v-if="huodong.mvideo.length">
					<view class="mt-1" v-for="(item,index) in huodong.mvideo" :key="index">
						<view class="d-flex j-sb a-center">
							<text style="max-width: 470rpx;">{{item.title}}</text>
							<view class="d-flex flex-row" style="height: 45rpx;">
								<view @tap="openmodifyideo(index)" class="videomodify">修改</view>
								<view @click="videosc(index)" class="videodele">删除</view>
							</view>
						</view>
						<video :src="item.video_url" class="video1" :poster="item.video_cover"></video>
						<divider />
					</view>
				</block>
				
				<block v-else>
					<view class="mb-2 text-center" style=" border-bottom: 1px solid #ccc; padding-bottom: 20rpx;">还未上传宣传视频，请先上传!</view>
				</block>
			</view>
			
			<view>
				<view style="font-size: 24rpx; color: #f00;">*默认已有姓名，电话字段</view>
				<view class="from-data-box">
					<text>报名表单类型：</text>
					<view @tap="openSelectFrom" class="from-box">
						<text class="from-text">{{selectFromNameId == 0 ? '默认' : type_name}}</text>
						<text>></text>
					</view>
				</view>
				
				<view v-if="selectFromNameId != 0">
					<view class="table-title">
						<text class="table-text1">文字提示</text>
						<text class="table-text2">字段名称</text>
						<text class="table-text2">字段类型</text>
						<text class="table-text2">是否必填</text>
					</view>
					<view v-for="(item,index) in huodong.extra_field_config" :key="index">
						<view class="data-box">
							<text class="data-text1">{{item.toast}}</text>
							<text class="data-text1">{{item.name}}</text>
							<text class="data-text1">{{item.type.value}}</text>
							<view class="data-text2">
								<text>{{item.necessary ? '是' : '否'}}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
			
			<!-- <view class="diyfrom-box">
				<view class="diyfrom-title">
					<text>自定义表单数据：</text>
					<view>
						<text @tap="openfrom" class="add-text">+新增字段</text>
						<text class="edit" @click="onClickEdit">{{delShow ? '退出' : '编辑'}}</text>
					</view>
				</view>
				
				<view class="diyfrom-tab">
					<text class="table-text1">文字提示</text>
					<text class="table-text2">字段名称</text>
					<text class="table-text2">字段类型</text>
					<text class="table-text2">是否必填</text>
				</view>
					
				<view class="from-data">
					<view v-for="(item, index) in huodong.extra_field_config" :key="index">
						<view class="data-box">
							<text class="data-text1">{{item.toast}}</text>
							<text class="data-text1">{{item.name}}</text>
							<text class="data-text1">{{item.type.value}}</text>
							<view class="data-text2" style="position: relative; align-items: center; display: flex; flex-direction: column;">
								<text>{{item.necessary ? '是' : '否'}}</text>
								<image src="../../static/edit.png" style="position: absolute;left: 0; top: 10rpx; width: 50rpx; height: 50rpx; border-radius: 50%;" v-show="delShow" @tap="openfromedit(index)"></image>
								<image src="../../static/del.png" style="position: absolute;right: 0; top: 10rpx; width: 50rpx; height: 50rpx; border-radius: 50%;" v-show="delShow" @click="delfromline(index)"></image>
							</view>
						</view>
						<view v-show="item.radioitem.length != 0">
							<view v-for="(item1, index1) in item.radioitem" :key="index1">
								<view style="display: flex; justify-content: space-around; border-bottom: 2rpx solid #000;">
									<view><text style="color: #999;">选项名：</text>{{item1.key}}</view>
									<view><text style="color: #999;">选项值：</text>{{item1.value}}</view>
								</view>
							</view>
						</view>
						
						<view v-show="item.checkboxitem.length != 0">
							<view v-for="(item1, index1) in item.checkboxitem" :key="index1">
								<view style="display: flex; justify-content: space-around; border-bottom: 2rpx solid #000;">
									<view><text style="color: #999;">选项名：</text>{{item1.key}}</view>
									<view><text style="color: #999;">选项值：</text>{{item1.value}}</view>
								</view>
							</view> -->
			
			<view class="mt-1" style="display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #ccc; margin-top: 20rpx;">
				<text>是否显示历史信息：<span style="color: #f00; font-size: 24rpx;">如：经销商报名信息等</span></text>
				<switch @change="switchChangeHistory" :checked="huodong.historyInfo == 0 ? false : true" v-model="huodong.historyInfo" style="transform:scale(0.7)" color="#475dfc"></switch>
			</view>
			
			<view><button class="share-but" @click="tijiao">提交修改</button></view>
			<view><button class="share-text" @click="fanhui">返回上一页</button></view>
		</view>
		<openAlert BgColor="rgba(0,0,0,0.7)" ref="openAlertSelectFrom" :AlertClass="0" :AlertPosition="'center'">
			<view style="width: 650rpx; padding: 30rpx; background-color: #fff; border-radius: 10rpx; max-height: 900rpx; position: relative;">
				<text @tap="reset" style="position: absolute; font-size: 26rpx; background-color: #475dfc; color: #fff; top: 4rpx; right: 4rpx; line-height: 46rpx; border-radius: 10rpx; padding: 0 14rpx;">恢复默认</text>
				<view class="" style="text-align: center; font-size: 34rpx; margin-bottom: 20rpx;">请点击表单名称</view>
				<view class=""  style="display: flex; flex-wrap: wrap; margin-top: 10rpx;">
					<view v-for="(item, index) in extra_field_list" :key="index" style="margin-bottom: 10rpx;">
						<text @tap="selectFromName(index)" :class="selectFromNameIndex == index ? 'from-index' : 'from-false'">
							{{item.name}}
						</text>
					</view>
				</view>
				<view class="confrim-close-box">
					<text @tap="selectFromClose" class="confrim-close">取消</text>
					<text @tap="selectFromConfrim" class="confrim-confrim">确认</text>
				</view>
			</view>
		</openAlert>
		
		<!-- <openAlert :BgColor="BgColor" closeBtn ref="openAlertFrom" :AlertClass="0" :AlertPosition="'center'"
		 :shadeClose="false">
			<view class="open-box">
				<view class="title">添加字段</view>
		
				<view class="toast">
					<text class="text">文字提示：</text>
					<input class="input" v-model="open_addfield.toast" placeholder="请输入文字提示" />
				</view>
		
				<view class="toast">
					<text class="text">字段名称：</text>
					<input class="input" v-model="open_addfield.name" placeholder="请输入字段名称" @blur="blur" />
				</view>
		
				<view class="toast">
					<text class="text">字段类型：</text>
					<xfl-select :list="selectList" :clearable="false" :showItemNum="5" :listShow="false" :isCanInput="false" ref="xflselect" :style_Container="'height: 35px; font-size: 16px; width: 100%'" :placeholder="open_editfield_value" :selectHideType="'hideAll'"
					 @change="onclickSelect">
					</xfl-select>
				</view>
		
				<view class="necessary">
					<text class="text">是否必填：</text>
					<checkbox-group @change="checkbox">
						<checkbox value="true" color="#475dfc" style="transform:scale(0.9); width: 50rpx;" />
					</checkbox-group>
				</view>
				
				<view v-show="radioShow" >
					<view style="display: flex; justify-content: space-between;">
						<text>单项选择器选项：</text>
						<view>
							<text @tap="openSelector" style="background-color: #475dfc; padding: 4rpx 10rpx; color: #fff; border-radius: 10rpx;">添加选项</text>
							<text @click="editradio" v-show="this.open_addfield.radioitem.length != 0" style="background-color: #475dfc; padding: 4rpx 10rpx; color: #fff; border-radius: 10rpx; margin-left: 20rpx;">{{delradio ? '退出' : '编辑'}}</text>
						</view>
					</view>
					
					<view v-show="this.open_addfield.radioitem.length != 0" >
						<view v-for="(item, index) in this.open_addfield.radioitem" :key="index">
							<view style="display: flex; justify-content: space-around; position: relative;">
								<view><text style="color: #999;">选项名：</text>{{item.key}}</view>
								<view><text style="color: #999;">选项值：</text>{{item.value}}</view>
								<image v-show="delradio" @click="delradiolist(index)" src="../../static/del.png" style="height: 50rpx; width: 50rpx; position: absolute; right: 0; top: 14rpx;"></image>
							</view>
						</view>
					</view>
				</view>
				
				<view v-show="checkboxShow">
					<view style="display: flex; justify-content: space-between;">
						<text>多项选择器选项：</text>
						<view>
							<text @tap="openCheckbox" style="background-color: #475dfc; padding: 4rpx 10rpx; color: #fff; border-radius: 10rpx;">添加选项</text>
							<text @click="editcheckboxlist" v-show="this.open_addfield.checkboxitem.length != 0" style="background-color: #475dfc; padding: 4rpx 10rpx; color: #fff; border-radius: 10rpx; margin-left: 20rpx;">{{delradio ? '退出' : '编辑'}}</text>
						</view>
					</view>
					
					
					<view v-show="this.open_addfield.checkboxitem.length != 0" >
						<view v-for="(item, index) in this.open_addfield.checkboxitem" :key="index">
							<view style="display: flex; justify-content: space-around; position: relative;">
								<view><text style="color: #999;">选项名：</text>{{item.key}}</view>
								<view><text style="color: #999;">选项值：</text>{{item.value}}</view>
								<image v-show="delradio" @click="delcheckboxlist(index)" src="../../static/del.png" style="height: 50rpx; width: 50rpx; position: absolute; right: 0; top: 14rpx;"></image>
							</view>
						</view>
					</view>
				</view>
				
				<button @click="onClickComplete" class="but">完成</button>
			</view>
			
			
			<openAlert :BgColor="BgColor" closeBtn ref="openAlertSelector" :AlertClass="0" :AlertPosition="'center'"
			 :shadeClose="false">
				<view style="background-color: #fff; width: 650rpx; border-radius: 10rpx; padding: 30rpx; line-height: 70rpx;">
					<view style="text-align: center;font-size: 34rpx;">添加选项</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项名：</text><input placeholder="请输入选项名" v-model="selector_list.key" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项值：</text><input placeholder="请输入选项值" v-model="selector_list.value" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<button @click="onclickSelector" style="margin-top: 30rpx;">完成</button>
				</view>
			</openAlert>
			
			<openAlert :BgColor="BgColor" closeBtn ref="openAlertCheckbox" :AlertClass="0" :AlertPosition="'center'"
			 :shadeClose="false">
				<view style="background-color: #fff; width: 650rpx; border-radius: 10rpx; padding: 30rpx;line-height: 70rpx;">
					<view style="text-align: center;font-size: 34rpx;margin-bottom: 30rpx;">添加选项</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项名：</text><input placeholder="请输入选项名" v-model="selector_list.key" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项值：</text><input placeholder="请输入选项值" v-model="selector_list.value" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<button @click="onclickCheckbox" style="margin-top: 30rpx;">完成</button>
				</view>
			</openAlert>
			
		</openAlert>
		
		<!-- <openAlert :BgColor="BgColor" closeBtn ref="openAlertFromEdit" :AlertClass="0" :AlertPosition="'center'"
		 :shadeClose="false">
			<view class="open-box">
				<view class="title">编辑字段</view>
		
				<view class="toast">
					<text class="text">文字提示：</text>
					<input class="input" v-model="open_editfield.toast" />
				</view>
		
				<view class="toast">
					<text class="text">字段名称：</text>
					<input class="input" v-model="open_editfield.name" @blur="blur" />
				</view>
		
				<view class="toast">
					<text class="text">字段类型：</text>
					<xfl-select :list="selectList" :clearable="false" :showItemNum="5" :listShow="false" :isCanInput="false" ref="xflselect" :style_Container="'height: 35px; font-size: 16px; width: 100%'" :placeholder="open_editfield_value" :selectHideType="'hideAll'"
					 @change="onclickSelect">
					</xfl-select>
				</view>
		
				<view class="necessary">
					<text class="text">是否必填：</text>
					<checkbox-group @change="checkbox">
						<checkbox value="true" color="#475dfc" :checked="open_editfield.necessary" style="transform:scale(0.9); width: 50rpx;" />
					</checkbox-group>
				</view>
				
				<view v-show="this.open_editfield.radioitem != 0" style="display: flex; justify-content: space-between;">
					<text>已有选项</text>
					<view>
						<text @tap="$refs.openAlertAdd.Show()" style="background-color: #475dfc; padding: 4rpx 10rpx;color: #fff; border-radius: 10rpx;">新增选项</text>
					</view>
				</view>
				
				<view v-show="this.open_editfield.checkboxitem != 0" style="display: flex; justify-content: space-between;">
					<text>已有选项</text>
					<view>
						<text @tap="$refs.openAlertAddCheck.Show()" style="background-color: #475dfc; padding: 4rpx 10rpx;color: #fff; border-radius: 10rpx;">新增选项</text>
					</view>
				</view>
				
				<view v-for="(item, index) in open_editfield.radioitem" :key="index">
					<view style="display: flex;align-items: center; line-height: 50rpx; position: relative;">
						<view style="width: 250rpx;"><text style="color: #999;">选项名：</text>{{item.key}}</view>
						<view><text style="color: #999;">选项值：</text>{{item.value}}</view>
						<view style="position: absolute; top: 0; right: 0;">
							<image @tap="editeditradio(index,0,'center')" src="../../static/edit.png" style="height: 50rpx; width: 50rpx;"></image>
							<image @click="editdelradio(index)" src="../../static/del.png" style="margin-left: 30rpx; height: 50rpx; width: 50rpx;"></image>
						</view>
					</view>
				</view>
				
				<view v-for="(item, index) in open_editfield.checkboxitem" :key="index">
					<view style="display: flex;align-items: center; line-height: 50rpx; position: relative;">
						<view style="width: 250rpx;"><text style="color: #999;">选项名：</text>{{item.key}}</view>
						<view><text style="color: #999;">选项值：</text>{{item.value}}</view>
						<view style="position: absolute; top: 0; right: 0;">
							<image @tap="editeditcheck(index,0,'center')" src="../../static/edit.png" style="height: 50rpx; width: 50rpx;"></image>
							<image @click="editdelcheck(index)" src="../../static/del.png" style="margin-left: 30rpx; height: 50rpx; width: 50rpx;"></image>
						</view>
					</view>
				</view>
				
				<button @click="onClickEditComplete" class="but">完成</button>
			</view>
			
			<openAlert :BgColor="BgColor" closeBtn ref="openAlertAdd" :AlertClass="0" :AlertPosition="'center'"
			 :shadeClose="false">
				<view style="background-color: #fff; width: 650rpx; border-radius: 10rpx; padding: 30rpx; line-height: 70rpx;">
					<view style="text-align: center;font-size: 34rpx;">添加选项</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项名：</text><input placeholder="请输入选项名" v-model="selector_list.key" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项值：</text><input placeholder="请输入选项值" v-model="selector_list.value" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<button @click="onclickAdd" style="margin-top: 30rpx;">完成</button>
				</view>
			</openAlert>
			
			<openAlert :BgColor="BgColor" closeBtn ref="openAlertAddCheck" :AlertClass="0" :AlertPosition="'center'"
			 :shadeClose="false">
				<view style="background-color: #fff; width: 650rpx; border-radius: 10rpx; padding: 30rpx; line-height: 70rpx;">
					<view style="text-align: center;font-size: 34rpx;">添加选项</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项名：</text><input placeholder="请输入选项名" v-model="selector_list.key" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项值：</text><input placeholder="请输入选项值" v-model="selector_list.value" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<button @click="onclickAddcheck" style="margin-top: 30rpx;">完成</button>
				</view>
			</openAlert>
			
			<openAlert :BgColor="BgColor" closeBtn ref="openAlertEdit" :AlertClass="0" :AlertPosition="'center'"
			 :shadeClose="false">
				<view style="background-color: #fff; width: 650rpx; border-radius: 10rpx; padding: 30rpx; line-height: 70rpx;">
					<view style="text-align: center;font-size: 34rpx;">添加选项</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项名：</text><input placeholder="请输入选项名" v-model="selector_list.key" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项值：</text><input placeholder="请输入选项值" v-model="selector_list.value" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<button @click="onclickEdit" style="margin-top: 30rpx;">完成</button>
				</view>
			</openAlert>
			
			<openAlert :BgColor="BgColor" closeBtn ref="openAlertEditCheck" :AlertClass="0" :AlertPosition="'center'"
			 :shadeClose="false">
				<view style="background-color: #fff; width: 650rpx; border-radius: 10rpx; padding: 30rpx; line-height: 70rpx;">
					<view style="text-align: center;font-size: 34rpx;">添加选项</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项名：</text><input placeholder="请输入选项名" v-model="selector_list.key" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<view style="display: flex; align-items: center;">
						<text style="min-width: 150rpx;">选项值：</text><input placeholder="请输入选项值" v-model="selector_list.value" style="width: 450rpx; background-color: #eee;height: 60rpx; border-radius: 6rpx; padding: 0 10rpx;"/>
					</view>
					
					<button @click="onclickEditCheck" style="margin-top: 30rpx;">完成</button>
				</view>
			</openAlert>
		</openAlert> -->
		
		<openAlert BgColor="rgba(0,0,0,0.7)" ref="openAlertaddmainVideo" :AlertClass="0" :AlertPosition="'center'"  closeBtn>
			<view class="addvidlist">
				<view class="font-lg text-center  mb-2">修改主视频</view>
				<view class="d-flex flex-column">
					<view class="d-flex flex-row j-sb align-center">
						<view class="text">主视频封面：</view>
						<view @click="uploadImage('maincover')" class="mainupdata">修改</view>
					</view>
					<view class="d-flex">
						<image :src="maincover ? maincover : '../../static/up-img.png'" :class="maincover ? 'upimg' : 'img'"></image>
					</view>
				</view>
				<divider />
				
				<view>
					<view class="d-flex a-center mb-1 j-sb">
						<view>主视频：</view>
						<view @tap="uploadVideo('mainvideo1')" class="addvideo">+ 修改视频</view>
					</view>
					
					<view v-if="!mainvideo1">
						<view class="mb-2 text-center">还未上传主视频，请先上传！</view>
					</view>
					<view v-else>
						<video :src="mainvideo1" class="video"></video>
					</view>
				</view>
				
				<button @click="mainConfirm()" class="qrbut">确认修改</button>
			</view>
		</openAlert>
		
		<openAlert BgColor="rgba(0,0,0,0.7)" ref="openAlertaddVideo" :AlertClass="0" :AlertPosition="'center'"  closeBtn>
			<view class="openupbox">
				<view class="font-lg text-center">上传新视频</view>
				<view class="mt-1">新视频标题：
					<input placeholder="请输入视频内容标题" type="text" v-model="addvideo.title" class="openinput"/>
				</view>
				
				<view>上传视频封面：</view>
				<image @click="uploadImage('addvideo')" :src="addvideo.video_cover ? addvideo.video_cover : '../../static/up-img.png'" :class="addvideo.video_cover ? 'img1' : 'img'"></image>
				<divider />
				
				<view>
					<view class="d-flex j-sb">
						<view>上传新视频：</view>
						<view @tap="uploadVideo('addvideo')" v-model="addvideo.videosrc" class="opentext">+ 上传视频</view>
					</view>
					<view v-if="!addvideo.videosrc">
						<!-- <view class="uni-hello-addfile" @tap="addVideo()" v-model="addvideo.videosrc">+ 上传视频</view> -->
					</view>
					<view v-else>
						<video :src="addvideo.videosrc" class="video"></video>
					</view>
				</view>
				
				<button @click="queren()" class="openqr">确认上传</button>
			</view>
		</openAlert>
		
		<openAlert BgColor="rgba(0,0,0,0.7)" ref="openAlertmodifyideo" :AlertClass="0" :AlertPosition="'center'" closeBtn>
			<view class="openmodifybox">
				<view class="text-center font-xmd" >修改视频</view>
				<view class="mt-3 mb-2">
					<view class="mb-1">修改视频标题：</view>
					<input :placeholder="videolist.title" v-model="videolist.title" class="omvideo"/>
				</view>
				
				<view class="d-flex flex-row j-sb align-center">
					<view class="text">视频封面：</view>
					<view @click="uploadImage('videolist')" class="mainupdata">修改</view>
				</view>
				<image :src="videolist.video_cover ? videolist.video_cover : '../../static/up-img.png'" :class="videolist.video_cover ? 'img1' : 'img'"></image>
				<divider />
				
				<view class="d-flex a-center mb-1 j-sb">
					<view>修改视频：</view>
					<view @tap="uploadVideo('videolist')" class="omtext">+ 上传视频</view>
				</view>
				<video :src="videolist.video_url" class="vidmod"></video>
				
				<button @click="qrmodify" class="vidqr">确认修改</button>
			</view>
		</openAlert>
		
	</view>
</template>

<script>
	import openAlert from "../../components/open-alert/open-alert.vue"
	import xflSelect from '../../components/xfl-select/xfl-select.vue'
	export default {
		components:{
			openAlert,
			xflSelect: xflSelect,
		},
		data() {
			return {
				BgColor: 'rgba(0,0,0,0.5)',
				AlertClass: 0,
				AlertPosition: '',
				huodong: {
					actname: '',
					actcontent: '',
					headimage:'',
					vidtopimg: '',
					footimage:'',
					main_video_cover: '',
					background:[],
					mainvideo:'',
					mvideo:[],
					extra_field_config: [],
					sharemaintitle: '',
					sharetitle: '',
					shareimage: '',
					price: '',
					link: '',
					historyInfo: 0,
					// before_authorize_btn: '',
					// after_authorize_btn: '',
					// whetherpay: '',
				},
				sginprice: true,
				activity_detail_data: {},
				addvideo:{
					title:'',
					video_cover: '',
					videosrc:'',
				},
				videoIndex: '',
				index: '',
				videolist:[],
				video_id: '',
				activity_id: '',
				color:{r: 0,g: 0,b: 0,a: 1},
				backgroundStyle:'',
				maincover:'',
				mainvideo1:'',
				delShow: false,
				selectList: [{
					value: '输入框',
					key: 'string'
				}, {
					value: '多行输入框',
					key: 'textarea'
				}, {
					value: '单张图片',
					key: 'oneimg'
				}, {
					value: '多张图片',
					key: 'manyimg'
				}],
				/* selectList: [{
					value: '输入框',
					key: 'string'
				}, {
					value: '多行输入框',
					key: 'textarea'
				}, {
					value: '单张图片',
					key: 'oneimg'
				}, {
					value: '多张图片',
					key: 'manyimg'
				}, {
					value: '单项选择器',
					key: 'radio'
				}, {
					value: '多项选择器',
					key: 'checkbox',
				}], */
				open_addfield: {
					toast: '',
					name: '',
					type: [],
					necessary: '',
					radioitem: [],
					checkboxitem: [],
				},
				open_editfield_value:'',
				placeholder:'',
				checked_value: false,
				openShow: true,
				open_editfield:[],
				edit_checked: '',
				join_list: [],
				repeat: false,
				selector_list: {
					key: '',
					value: ''
				},
				radiolist: '',
				radioShow: false,
				checkboxShow: false,
				delradio: false,
				radioInindex: '',
				radioInindexEdit: '',
				from_data_show: false,
				extra_field_list: [],
				selectFromNameIndex: -1,
				selectFromNamelist: [],
				selectFromNameId: 0,
				type_name: '',
				// page_from: [],
				// backgroundStyle:"background-color:rgba(255,0,0,1);display: inline-block; width: 30rpx; height: 30rpx;"
			};
		},
		onLoad(e) {
			// console.log(e);
			this.activity_id = e.activity_id;
			this.$comm.appLogin(user_info=>{
				this.activity_detail(e.id);
				this.extra_field_type_list()
			})
		},
		methods:{
			selectFromClose() {
				this.$refs.openAlertSelectFrom.Close()
				this.selectFromNameIndex = -1
			},
			
			reset() {
				this.selectFromNameId = 0
				this.selectFromNameIndex = -1
				this.selectFromNamelist = []
				this.from_data_show = false
				this.selectFromNameData = []
				this.$refs.openAlertSelectFrom.Close()
			},
			
			openSelectFrom() {
				// console.log(this.extra_field_list,909090)
				for (let i = 0; i < this.extra_field_list.length; i++) {
					if (this.selectFromNameId == this.extra_field_list[i].id) {
						this.selectFromNameIndex = i
					}
				}
				this.$refs.openAlertSelectFrom.Show()
			},
			
			selectFromConfrim() {
				this.selectFromNamelist = this.extra_field_list[this.selectFromNameIndex]
				if (this.selectFromNamelist == undefined) {
					this.errEvent('请先选择需要的表单', 'none', 2000)
					return
				}
				this.huodong.extra_field_config = JSON.parse(this.selectFromNamelist.extra_field_config)
				this.selectFromNameId = this.selectFromNamelist.id
				// console.log(this.selectFromNameId,90909999)
				this.type_name = this.selectFromNamelist.name
				// console.log(this.huodong.extra_field_config, this.selectFromNameId, this.type_name, '请先选择需要的表单')
				// this.selectFromNameData = this.selectFromNamelist
				this.from_data_show = true
				this.$refs.openAlertSelectFrom.Close()
			},
			
			selectFromName(index) {
				this.selectFromNameIndex = index
				// this.selectFromNamelist = this.extra_field_list[index]
				// console.log(this.extra_field_list[index])
			},
			
			extra_field_type_list() {
				this.$comm.request({
					url: 'api/extra_field_type_list',
					method: 'GET',
					success: (res) => {
						this.extra_field_list = res.data.result.list
					}
				})
			},
						
			switchChangeHistory: function (e) {
				this.huodong.historyInfo = e.detail.value
				if (this.huodong.historyInfo == true) this.huodong.historyInfo = 1
				else this.huodong.historyInfo = 0
				// console.log(this.historyInfo, this.huodong)
			},
			
			switchChange: function (e) {
				// console.log(e.detail.value)
				this.sginprice = e.detail.value
			},
			
			editradio() {
				this.delradio = !this.delradio
			},
			
			delradiolist(index) {
				this.open_addfield.radioitem.splice(index, 1)
			},
			
			editcheckboxlist(index) {
				this.delradio = !this.delradio
			},
			
			delcheckboxlist(index) {
				this.open_addfield.checkboxitem.splice(index, 1)
			},
			
			onclickEdit() {
				if (this.selector_list.key == '') {
					this.errEvent('选项名不能为空', 'none')
					return
				}
				if (this.selector_list.value == '') {
					this.errEvent('选项值不能为空', 'none')
					return
				} 
				this.$set( this.open_editfield.radioitem, this.radioInindexEdit, this.selector_list)
				this.selector_list = {
					key: '',
					value: ''
				}
				this.$refs.openAlertEdit.Close();
			},
			
			onclickEditCheck() {
				if (this.selector_list.key == '') {
					this.errEvent('选项名不能为空', 'none')
					return
				}
				if (this.selector_list.value == '') {
					this.errEvent('选项值不能为空', 'none')
					return
				} 
				this.$set( this.open_editfield.checkboxitem, this.radioInindexEdit, this.selector_list)
				this.selector_list = {
					key: '',
					value: ''
				}
				this.$refs.openAlertEditCheck.Close();
			},
			
			editeditradio(index, Class, Position) {
				this.radioInindexEdit = index
				this.selector_list = {
					key: '',
					value: ''
				}
				this.selector_list = JSON.parse(JSON.stringify(this.open_editfield.radioitem[index]))
				this.$refs.openAlertEdit.Show();
			},
			
			editeditcheck(index) {
				this.radioInindexEdit = index
				this.selector_list = {
					key: '',
					value: ''
				}
				this.selector_list = JSON.parse(JSON.stringify(this.open_editfield.checkboxitem[index]))
				this.$refs.openAlertEditCheck.Show();
			},
			
			editdelradio(index) {
				this.open_editfield.radioitem.splice(index, 1)
			},
			
			editdelcheck(index) {
				this.open_editfield.checkboxitem.splice(index, 1)
			},
			
			onclickAdd() {
				if (this.selector_list.key == '') {
					this.errEvent('选项名不能为空', 'none')
					return
				}
				if (this.selector_list.value == '') {
					this.errEvent('选项值不能为空', 'none')
					return
				} 
				this.open_editfield.radioitem.push(this.selector_list)
				this.selector_list = {
					key: '',
					value: ''
				}
				this.$refs.openAlertAdd.Close();
			},
			
			onclickAddcheck() {
				if (this.selector_list.key == '') {
					this.errEvent('选项名不能为空', 'none')
					return
				}
				if (this.selector_list.value == '') {
					this.errEvent('选项值不能为空', 'none')
					return
				} 
				this.open_editfield.checkboxitem.push(this.selector_list)
				this.selector_list = {
					key: '',
					value: ''
				}
				this.$refs.openAlertAddCheck.Close();
			},
			
			onclickCheckbox() {
				if (this.selector_list.key == '') {
					this.errEvent('选项名不能为空', 'none')
					return
				}
				if (this.selector_list.value == '') {
					this.errEvent('选项值不能为空', 'none')
					return
				} 
				this.open_addfield.checkboxitem.push(this.selector_list)
				this.selector_list = {
					key: '',
					value: ''
				},
				this.$refs.openAlertCheckbox.Close();
			},
			
			onclickSelector() {
				if (this.selector_list.key == '') {
					this.errEvent('选项名不能为空', 'none')
					return
				}
				if (this.selector_list.value == '') {
					this.errEvent('选项值不能为空', 'none')
					return
				} 
				this.open_addfield.radioitem.push(this.selector_list)
				// console.log(this.selector_list,this.open_addfield.radioitem,99)
				// console.log(this.open_addfield,99999)
				this.selector_list = {
					key: '',
					value: ''
				}
				this.$refs.openAlertSelector.Close();
			},
			
			openSelector() {
				this.selector_list = {
					key: '',
					value: ''
				},
				this.$refs.openAlertSelector.Show();
			},
			
			openCheckbox() {
				this.selector_list = {
					key: '',
					value: ''
				},
				this.$refs.openAlertCheckbox.Show();
			},
			
			blur: function(event) {  
				this.repeat = false
				// console.log(event.target.value)
				for (let i = 0; i < this.join_list.length; i++) {
					if (event.target.value == this.join_list[i]) {
						this.errEvent('字段名称存在重复', 'none')
						this.repeat = true
						return
					}
				}
			},
			
			openfromedit(index) {
				this.radioInindex = index
				// this.open_editfield = this.huodong.extra_field_config[index]
				this.open_editfield = JSON.parse(JSON.stringify(this.huodong.extra_field_config[index]))
				this.placeholder = this.open_editfield.type.value
				this.checked_value = this.open_editfield.necessary
				this.open_editfield_value = this.open_editfield.type.value
				this.join_list = []
				for (let i = 0; i < this.huodong.extra_field_config.length; i++) {
					this.join_list.push(this.huodong.extra_field_config[i].name)
				}
				this.join_list.splice(index, 1)
				console.log(this.join_list)
				this.$refs.openAlertFromEdit.Show();
			},
			
			onClickEditComplete() {
				if (this.open_editfield.toast == '') {
					this.errEvent('文字提示不能为空', 'none')
					return
				}
				if (this.open_editfield.name == '') {
					this.errEvent('字段名称不能为空', 'none')
					return
				} else {
					let text = /^[a-zA-Z_]+$/;
					if (!text.test(this.open_editfield.name)) {
						this.errEvent('字段名称只能为英文和下划线', 'none')
						return
					}
				}
				if (this.open_editfield.type == '') {
					this.errEvent('字段类型不能为空', 'none')
					return
				}
				if (this.repeat == true) {
					this.errEvent('字段名称存在重复', 'none')
					return
				}
				this.open_editfield.necessary = this.checked_value
				this.$set( this.huodong.extra_field_config, this.radioInindex, this.open_editfield)
				// console.log(this.open_editfield,99)
				this.open_editfield_value = ''
				// console.log(this.open_editfield_value,'onClickEditComplete')
				this.join_list = ''
				this.$refs.openAlertFromEdit.Close();
			},
			
			onClickComplete() {
				if (this.open_addfield.toast == '') {
					this.errEvent('文字提示不能为空', 'none')
					return
				}
				if (this.open_addfield.name == '') {
					this.errEvent('字段名称不能为空', 'none')
					return
				} else {
					let text = /^[a-zA-Z_]+$/;
					if (!text.test(this.open_addfield.name)) {
						this.errEvent('字段名称只能为英文和下划线', 'none')
						return
					}
				}
				if (this.open_addfield.type == '') {
					this.errEvent('字段类型不能为空', 'none')
					return
				}
				if (this.repeat == true) {
					this.errEvent('字段名称存在重复', 'none')
					return
				}
				this.open_addfield.necessary = this.checked_value
				this.huodong.extra_field_config.push(this.open_addfield)
				// this.page_from.push(this.open_addfield)
				this.open_addfield = {
					toast: '',
					name: '',
					type: [],
					necessary: '',
					radioitem: [],
					checkboxitem: []
				},
				// console.log(this.page_from, 'page_from', this.open_addfield)
				this.$refs.xflselect.onClear()
				this.$emit('onclickdiyfrom',this.page_from)
				this.open_editfield_value = ''
				this.join_list = []
				this.$refs.openAlertFrom.Close();
			},
			
			onclickSelect(e) {
				this.open_addfield.type = e.orignItem
				this.open_editfield.type = e.orignItem
				// console.log(e,this.open_addfield)
				if (e.orignItem.key == 'radio') {
					this.radioShow = true
					this.checkboxShow = false
				} else if (e.orignItem.key == 'checkbox') {
					this.checkboxShow = true
					this.radioShow = false
				} else {
					this.checkboxShow = false
					this.radioShow = false
				}
				this.selector_list = {
					key: '',
					value: ''
				}
			},
			
			checkbox() {
				this.checked_value = !this.checked_value
			},
			
			openfrom() {
				this.radioShow = false
				this.checkboxShow = false
				this.open_editfield_value = '请输入'
				this.join_list = []
				// console.log(this.huodong.extra_field_config)
				if (this.huodong.extra_field_config == null || this.huodong.extra_field_config == '') {
					this.huodong.extra_field_config = []
				} else {
					for (let i = 0; i < this.huodong.extra_field_config.length; i++) {
						// console.log(this.join_list,this.huodong.extra_field_config[i].name);
						// this.join_list = this.huodong.extra_field_config[i].name
					   this.join_list.push(this.huodong.extra_field_config[i].name)
					}
				}
				// console.log(this.join_list)
				this.$refs.openAlertFrom.Show();
			},
			
			onClickEdit() {
				this.delShow = !this.delShow
			},
			
			delfromline(index){
				this.huodong.extra_field_config.splice(index, 1)
			},
			
			//活动提交
			tijiao(){
				var id = this.activity_id
				let data = this.huodong;
				// data.whetherpay = this.sginprice
				if (data.actname == '') {
					this.errEvent('活动名称不能为空', 'none')
					return false
				}
				if (data.actcontent == '') {
					this.errEvent('活动内容不能为空', 'none')
					return false
				}
				if (data.price == '') {
					this.errEvent('报名价格不能为空', 'none')
					return false
				}
				if (data.link == '') {
					this.errEvent('授权链接不能为空', 'none')
					return false
				}
				if (data.sharemaintitle == '') {
					this.errEvent('活动分享主标题不能为空', 'none')
					return false
				}
				if (data.sharetitle == '') {
					this.errEvent('活动分享副标题不能为空', 'none')
					return false
				}
				if (data.main_video_cover == '') {
					this.errEvent('主视频封面不能为空', 'none')
					return false
				}
				if (data.mainvideo == '') {
					this.errEvent('主视频不能为空', 'none')
					return false
				}
				if (data.extra_field_config == null) {
					data.extra_field_config = []
				}
				console.log(this.huodong,'tijiao')
				this.$comm.request({
					url:'api/activity_update',
					method:'POST',
					data:{
						id: id,
						title: data.actname,
						content: data.actcontent,
						top_img: data.headimage,
						main_video_cover: data.main_video_cover,
						video_top_img: data.vidtopimg,
						bottom_img: data.footimage,
						background: data.background,
						main_video: data.mainvideo,
						video_list_json: JSON.stringify(data.mvideo),
						extra_field_config: JSON.stringify(data.extra_field_config),
						share_title: data.sharemaintitle,
						share_content: data.sharetitle,
						share_img: data.shareimage,
						pay_price: data.price,
						link: data.link,
						enter_history: data.historyInfo,
						type: this.selectFromNameId,
					},
					success: res=>{
						var res = res.data;
						console.log(res,'api/activity_update')
						if (res.code == 200) {
							this.errEvent(res.msg, 'success')
							uni.navigateTo({ 
								 url: 'activity',
							});
							return
						} else {
							this.errEvent(res.msg, 'none')
						}
					}
				});
			},
			
			fanhui(){
				uni.navigateTo({
					url: 'activity'
				})
			},
			
			uploadImage(parameter) {
				uni.chooseImage({
					count: 1,
					sizeType: ['original', 'compressed'],
					sourceType: ['album'],
					success: (res) => {
						// console.log(res,6666)
						this.$comm.ossUpFile(res.tempFiles[0], (url) => {
							// console.log(url,6666)
							if (parameter == 'maincover') {
								this.maincover = url
							} else if (parameter == 'videolist') {
								this.videolist.video_cover = url
							} else if (parameter == 'addvideo') {
								this.addvideo.video_cover = url
							} else if (parameter == 'headimage') {
								this.huodong.headimage = url
							} else if (parameter == 'footimage') {
								this.huodong.footimage = url
							} else if (parameter == 'shareimage') {
								this.huodong.shareimage = url
							} else if (parameter == 'vidtopimg') {
								this.huodong.vidtopimg = url
							}
						});
					}
				})
			},
			
			uploadVideo(parameter) {
				uni.chooseVideo({
					success: (res) => {
						console.log(res)
						res['path'] = res['tempFilePath']
						this.$comm.ossUpFile(res, (url) => {
							console.log(url,6666)
							if (parameter == 'addvideo') {
								this.$set(this.addvideo,'videosrc',url);
							} else if (parameter == 'mainvideo1') {
								this.mainvideo1 = url
							} else if (parameter == 'videolist') {
								this.$set(this.videolist,'video_url',url);
							}
						});
					}
				})
			},
			
			//确认上传视频
			queren(){
				if (this.addvideo.title == '') {
					this.errEvent('视频标题不能为空', 'none')
					return
				}
				if (this.addvideo.videosrc == '') {
					this.errEvent('未上传视频', 'none')
					// this.$refs.openAlertaddVideo.Close();
					return
				}
				this.huodong.mvideo.push(this.addvideo)
				this.$refs.openAlertaddVideo.Close();
				this.addvideo = {
					title:'',
					video_cover: '',
					videosrc:'',
				}
			},
			
			//修改视频
			qrmodify(){
				console.log(this.videolist,999)
				if (this.videolist.title == '') {
					this.errEvent('视频标题不能为空', 'none')
					return
				}
				if (this.videolist.video_url == '') {
					this.errEvent('未上传视频', 'none')
					return
				}
				this.$set(this.huodong.mvideo,this.videoIndex,this.videolist)
				// console.log( this.huodong.mvideo)
				this.$refs.openAlertmodifyideo.Close(); 
			},
			
			//打开修改弹出层并获取数据
			openmodifyideo(index, Class, Position){
				this.videoIndex = index
				// console.log(this.huodong.mvideo[index])
				// console.log(index)
				var id = this.activity_id
				// console.log(this.activity_detail_data.video_list[index])
				this.video_id = this.activity_detail_data.video_list[index].id
				// console.log(this.huodong.mvideo[index])
				this.videolist = JSON.parse(JSON.stringify(this.huodong.mvideo[index]));
				this.$refs.openAlertmodifyideo.Show(); 
			},
			
			//背景色
			show_color_picker(){
				this.$refs.colorPicker.open()
			},
			
			confirm(e){
				this.color = e.rgba
				console.log(this.color)
				let rgba_style = "background-color:rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"
				this.backgroundStyle = rgba_style+";display: inline-block; width: 30rpx; height: 30rpx;";
				// this.color = "{r:"+this.color.r+", g:"+this.color.g+", b:"+this.color.b+", a:"+this.color.a+"}"
				// let rgba = e.rgba
				// rgba(63,81,181,1)
				this.huodong.background = "rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"
			},
			
			//删除视频
			videosc(index){
				console.log(index);
				this.huodong.mvideo.splice(index, 1)
			},
			
			//获取活动信息
			activity_detail(id) {
				this.$comm.request({
					url: 'api/activity_detail?activity_id=' + this.activity_id,
					method: 'GET',
					success: res => {
						let data = this.huodong
						let data1 = res.data.result
						this.activity_detail_data = data1;
						data.actname = data1.title;
						data.actcontent = data1.content;
						data.background = data1.background;
						data.headimage = data1.top_img;
						data.footimage = data1.bottom_img;
						data.main_video_cover = data1.main_video_cover;
						data.vidtopimg = data1.video_top_img;
						data.mainvideo = data1.main_video;
						data.mvideo = data1.video_list;
						data.extra_field_config = JSON.parse(data1.extra_field_config)
						if (data1.share_title == null) data.sharemaintitle = ''
						else data.sharemaintitle = data1.share_title
						if (data1.share_content == null) data.sharetitle = ''
						else data.sharetitle = data1.share_content
						if (data1.share_img == null) data.shareimage = ''
						else data.shareimage = data1.share_img
						if (data1.pay_price == null) data.price = ''
						else data.price = data1.pay_price
						if (data1.link == null) data.link == ''
						else data.link = data1.link
						if (data1.enter_history == null) data.historyInfo = 0
						else data.historyInfo = data1.enter_history
						this.selectFromNameId = data1.type
						this.type_name = data1.type_name
						// data.before_authorize_btn = data1.before_authorize_btn
						// data.after_authorize_btn = data1.after_authorize_btn
						// data.whetherpay = data1.need_pay
						console.log(data1,'活动信息',this.type_name);
					}
				});
			},
			
			//确认上传主视频
			mainConfirm(){
				if (!this.maincover) {
					this.errEvent('主视频封面不能为空', 'none')
					return false
				}
				if (!this.mainvideo1) {
					this.errEvent('主视频不能为空', 'none')
					return false
				}
				this.huodong.main_video_cover = this.maincover;
				this.huodong.mainvideo = this.mainvideo1;
				this.$refs.openAlertaddmainVideo.Close(); 
			},
			
			//添加主视频弹出层
			openaddmainVideo(Class, Position) {
				this.maincover = this.huodong.main_video_cover
				this.mainvideo1 = this.huodong.mainvideo
				this.$refs.openAlertaddmainVideo.Show();
			},
			
			errEvent(msg, icon){
				uni.showToast({
					title: msg,
					icon: `${icon}` 
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/common/main.css';
	@import  '@/common/zcm-main.css';
	
	.from-index {
		padding: 6rpx 16rpx; border: 1px solid #475dfc; line-height: 60rpx; border-radius: 10rpx; background-color: #475dfc; color: #fff; margin-left: 10rpx;
	}
	
	.from-false {
		padding: 6rpx 16rpx; border: 1px solid #ccc; line-height: 60rpx; border-radius: 10rpx; margin-left: 10rpx;
	}
	
	.confrim-close-box {
		display: flex; justify-content: space-around;align-items: center;
		
		.confrim-close {
			padding: 20rpx 60rpx; border: 1px solid #aaa; border-radius: 10rpx; margin-top: 20rpx;
		}
		.confrim-confrim {
			padding: 20rpx 60rpx; border: 1px solid #475cfc; border-radius: 10rpx; margin-top: 20rpx; color: #fff; background-color: #475cfc;
		}
	}
	
	
	.from-data-box {
		display: flex; align-items: center;
		
		.from-box {
			width: 65%; border: 1px solid #ccc; line-height: 60rpx; padding: 0 20rpx; border-radius: 10rpx; display: flex; justify-content: space-between; align-items: center;
		}
		
		.from-text {
			overflow: hidden; word-break: break-all; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; color: #555;
		}
	}
	
	.table-title {
		margin-top: 10rpx;
		display: flex;
		justify-content: space-around;
		line-height: 70rpx;
		background-color: #eee;
	
		.table-text1 {
			width: 25%;
			text-align: center;
			border: 2rpx solid #000;
		}
	
		.table-text2 {
			width: 25%;
			text-align: center;
			border: 2rpx solid #000;
			border-left: none;
		}
	}
	
	.data-box {
		display: flex;
		justify-content: space-around;
		border-right: 2rpx solid #000;
		border-left: 2rpx solid #000;
			
		.data-text1 {
			word-break:break-all;
			width: 25%;
			text-align: center;
			border-right: 2rpx solid #000;
			border-bottom: 2rpx solid #000;
			padding: 20rpx 0;
		}
			
		.data-text2 {
			width: 25%;
			text-align: center;
			padding: 20rpx 0;
			border-bottom: 2rpx solid #000;
			position: relative; 
			align-items: center; 
			display: flex; 
			flex-direction: column;
		}
	}
	
	.open-box {
		background-color: #fff;
		padding: 30rpx;
		width: 650rpx;
		line-height: 80rpx;
		border-radius: 10rpx;
	
		.title {
			font-size: 34rpx;
			text-align: center;
			font-weight: bold;
		}
	
		.toast {
			display: flex;
			align-items: center;
	
			.text {
				min-width: 150rpx;
			}
	
			.input {
				background-color: #eee;
				width: 100%;
				border-radius: 10rpx;
				height: 60rpx;
				padding: 0 10rpx;
			}
		}
	
		.necessary {
			display: flex;
			justify-content: space-between;
		}
		
		.but {
			background-color: #475dfc;
			margin-top: 20rpx; 
			color: #fff;
		}
	}
	
	.diyfrom-box {
		margin-top: 20rpx;
		
		.diyfrom-title {
			margin-bottom: 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.add-text {
				background-color: #475dfc;
				padding: 4rpx 10rpx; 
				border-radius: 10rpx;
				color: #fff;
			}
			
			.edit {
				margin-left: 20rpx;
				background-color: #475dfc;
				padding: 4rpx 10rpx;
				color: #fff; 
				border-radius: 10rpx;
			}
		}
		
		.diyfrom-tab {
			display: flex;
			text-align: center;
			line-height: 70rpx;
			margin-top: 10rpx;
			border: 2rpx solid #000;
			
			.table-text1 {
				width: 25%;
			}
			
			.table-text2 {
				border-left: 2rpx solid #000;
				width: 25%;
			}
		}
		
		.from-data {
			border-left: 2rpx solid #000;
			border-right: 2rpx solid #000;
			line-height: 70rpx;
		
			.data-box {
				display: flex;
				justify-content: space-around;
		
				.data-text1 {
					word-break:break-all;
					width: 25%;
					text-align: center;
					border-right: 2rpx solid #000;
					border-bottom: 2rpx solid #000;
				}
		
				.data-text2 {
					width: 25%;
					text-align: center;
					border-bottom: 2rpx solid #000;
				}
			}
		}
	}
	
	page{
		font-size: 30rpx;
	}
	.mcolor {
		width: 40rpx; 
		height: 40rpx; 
		border: solid 4rpx #999; 
		box-shadow: 7rpx 7rpx #d9d9d9; 
		border-radius: 5rpx;
	}
	.openupbox {
		background-color: #ffffff; 
		width: 650rpx; 
		border-radius: 30rpx; 
		padding: 50rpx 50rpx 70rpx 50rpx;
	}
	.openinput {
		margin:10rpx 0 20rpx 0; 
		background-color: #F1F1F1;
		border-radius: 10rpx; 
		height: 60rpx; 
		padding: 0 10rpx 0 20rpx; 
		font-size: 30rpx;
	}
	.opentext {
		color: #fff; 
		background-color: #475dfc; 
		border-radius: 50rpx; 
		padding: 3rpx 15rpx 3rpx 15rpx;
	}
	.openqr {
		text-align: center; 
		background-color: #475dfc; 
		color: #fff; margin-top: 50rpx;
	}
	.videomodify {
		background-color: #475dfc; 
		color: #fff; 
		border-radius: 50rpx 0 0 50rpx; 
		padding: 0 10rpx 0 15rpx;
	}
	.videodele {
		color: #475dfc; 
		padding: 0 15rpx 0 10rpx; 
		border: solid 2rpx #475dfc; 
		border-radius: 0 50rpx 50rpx 0;
	}
	.video1 {
		margin-top: 10rpx; 
		width: 100%; 
		height: 300rpx;
	}
	.divide{
		background-color: #d9d9d9; 
		height: 3rpx; width: 100%; 
		margin-bottom: 20rpx;
	}
	.img {
		height: 150rpx; 
		width: 150rpx; 
		margin: 10rpx 30rpx 0rpx 0;
		padding: 48rpx; 
		border: solid 5rpx #EDEDED;
	}
	.img1 {
		height: 150rpx; 
		width: 150rpx; 
		margin: 10rpx 0rpx 20rpx 0rpx;
	}
	.upimg {
		height: 150rpx; 
		width: 150rpx; 
		margin: 10rpx 30rpx 20rpx 0;
	}
	.modvideo {
		display: flex; 
		align-items: center; 
		margin-bottom: 15rpx; 
		justify-content: space-between;
	}
	.mainupdata {
		border-radius: 50rpx; 
		background-color: #475dfc;
		color: #fff; 
		padding: 3rpx 20rpx 3rpx 20rpx;
	}
	.addmodvid {
		color: #fff; 
		background-color: #475dfc; 
		border-radius: 50rpx; 
		padding: 3rpx 15rpx 3rpx 15rpx;
	}
	.uni-hello-addfile {
        text-align: center;
        line-height: 200rpx;
        background: #F1F1F1;
        padding: 50rpx;
		height: 300rpx;
        margin-top: 10px;
        font-size: 35rpx;
        color: #808080;
		margin-bottom: 20rpx;
    }
		.video {
		margin-bottom: 10rpx;
			width: 100%;
			height: 300rpx;
			margin-top: 10rpx;
		}
	@mixin but {
		margin-top: 20rpx;
		margin-bottom: 20rpx;
		color: #ffffff;
	}
	.share-but {
		@include but;
		background-color: #475dfc;
		margin-top: 40rpx;
	}
	.share-text {
		@include but;
		color: #000;
		margin-top: 40rpx;
	}
	.addvidlist{
		background-color: #ffffff; 
		width: 650rpx; 
		border-radius: 30rpx; 
		padding: 30rpx 50rpx 50rpx 50rpx;
		
		.addvideo{
			color: #fff; 
			background-color: #475dfc; 
			border-radius: 50rpx; 
			padding: 3rpx 15rpx 3rpx 15rpx;
		}
		
		.qrbut{
			text-align: center;
			background-color: #475dfc; 
			color: #fff; 
			margin-top: 50rpx;
		}
	}
	.openmodifybox {
		background-color: #fff; 
		width: 650rpx; 
		padding: 40rpx; 
		border-radius: 20rpx;
	}
	.omvideo {
		background-color: #f1f1f1; 
		height: 60rpx; 
		border-radius: 10rpx; 
		padding-left: 10rpx;
	}
	.omtext {
		color: #fff; 
		background-color: #475dfc; 
		border-radius: 50rpx; 
		padding: 0 10rpx 0 10rpx;
	}
	.vidmod {
		width: 100%; 
		height: 300rpx;
	}
	.vidqr {
		margin-top: 30rpx;
		background-color: #475dfc;
		color: #fff;
	}
	.share {
		// width: 550rpx;
		background-color: #FFF;
		padding: 30rpx 50rpx 50rpx 50rpx;
		// border-radius: 12rpx;
	}
</style>
